home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20021006-20030409 / 000267_tom.horsley@att.net_Fri Feb 7 15:06:09 EST 2003.msg < prev    next >
Text File  |  2020-01-01  |  3KB  |  82 lines

  1. Article: 14061 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!panix!nycmny1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.gtei.net!wn12feed!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail
  3. Sender: tom@SPIKE
  4. Newsgroups: comp.protocols.kermit.misc
  5. Subject: input pattern matching blowing my mind...
  6. From: tom.horsley@att.net (Thomas A. Horsley)
  7. Message-ID: <uisvwssje.fsf@att.net>
  8. Lines: 62
  9. User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
  10. MIME-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. NNTP-Posting-Host: 8045abab4473203c19392f2a14c86b04
  13. X-Complaints-To: abuse@worldnet.att.net
  14. X-Trace: bgtnsc05-news.ops.worldnet.att.net 1044586885 8045abab4473203c19392f2a14c86b04 (Fri, 07 Feb 2003 03:01:25 GMT)
  15. NNTP-Posting-Date: Fri, 07 Feb 2003 03:01:25 GMT
  16. Organization: AT&T Worldnet
  17. Date: Fri, 07 Feb 2003 03:01:25 GMT
  18. Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14061
  19.  
  20. Running 2.1.3 k95 gui kermit on Windows XP.
  21.  
  22. Here is a fragment of a script I've been playing with to try and recognize
  23. the sorts of passphrase prompts generated by openssh:
  24.  
  25. ;
  26. ; Testing hacks...
  27. ;
  28. output \13
  29. input 10 \Fpattern({\10l*x>?})
  30. if success {
  31.    output echo \39Saw prompt ---\v(inmatch)---\39\13
  32.    input 10 \Fpattern({\10l*x>?})
  33.    output sh ./booger\13
  34.    input 10 \Fpattern({nter?passphrase?for*:?})
  35. ;   input 10 {\10Enter passphrase for}
  36.    if success {
  37.       output echo \39Saw message ---\v(inmatch)---\39\13
  38.    }
  39. ;   output ssh-add\13
  40. ;   input 10 \Fpattern({Enter?passphrase?for?*:?})
  41. ;   if success {
  42. ;      askq /GUI \%p \v(inmatch)
  43. ;      output \%p\13
  44. ;   }
  45. }
  46. connect
  47.  
  48. The first couple of patterns are just to see if pattern matching works at
  49. all (it does, and I find inmatch set to the expected prompt string which on
  50. the system I am connected to is actually "linux> ").
  51.  
  52. The "booger" shell script I invoke simply does an echo of an ssh prompt like
  53. string so I can test without actually running ssh commands.
  54.  
  55. The next set of variously commented out stuff shows the pattern I finally
  56. got to work. Note that the leading "E" in the "Enter" is left out of
  57. the pattern.
  58.  
  59. Apparently I can't match an upper case E at the beginning of the pattern
  60. come hell or high water :-).
  61.  
  62. I suspect something is going on with case twiddling, because when I try the
  63. commented out variation without the pattern, the contents of inmatch which
  64. echoes has a lower case "enter" at the beginning instead of "Enter" (the
  65. string actually generated by the "booger" script).
  66.  
  67. Are there bugs here? Or am I just not aquainted with the devious
  68. details of what is going on?
  69.  
  70. I tried [Ee] and ? in place of the leading E and neither one of
  71. those variations worked. I can only get this to match when I
  72. ignore the leading E completely (when using patterns).
  73.  
  74. P.S. In case it matters, the actual "booger" script looks like:
  75.  
  76. echo Enter passphrase for google google oogly woogly: 
  77.  
  78. --
  79. >>==>> The *Best* political site <URL:http://www.vote-smart.org/> >>==+
  80.       email: Tom.Horsley@worldnet.att.net icbm: Delray Beach, FL      |
  81. <URL:http://home.att.net/~Tom.Horsley> Free Software and Politics <<==+
  82.